<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style>
      html,
      body {
        margin: 0;
      }
      .box {
        display: flex;
        flex-wrap: wrap;
      }
      .item {
        width: 100px;
        height: 100px;
        background-color: red;
      }
    </style>
  </head>
  <body>
    123
    <!-- <div class="box">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
  <div class="item">4</div>
  <div class="item">5</div>
  <div class="item">6</div>
  <div class="item">7</div>
  <div class="item">8</div>
  <div class="item">9</div>
  <div class="item">10</div>
</div> -->

    <script>
      /**
       * 查看当前设备的像素比
       */
      console.log("设备像素比", window.devicePixelRatio);

      /**
       * 当前页面的宽度
       *    window.document.documentElement: <html>
       */
      console.log(
        "当前页面的宽度",
        window.document.documentElement.offsetWidth
      );
    </script>
  </body>
</html>
